Skip to content

[docs] Document project serverReadyAction override in VS Code extension - #1459

Open
aspire-repo-bot[bot] wants to merge 5 commits into
release/13.5from
docs/pr-19200-server-ready-action-e153bef62c30999d
Open

[docs] Document project serverReadyAction override in VS Code extension#1459
aspire-repo-bot[bot] wants to merge 5 commits into
release/13.5from
docs/pr-19200-server-ready-action-e153bef62c30999d

Conversation

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Documents changes from microsoft/aspire#19200

@ellahathaway

Targeting release/13.5 — the latest release branch on microsoft/aspire.dev — because release/13.6 (from the source PR milestone 13.6) does not exist there.

Why

The source PR fixes a bug where the VS Code extension replaced an explicitly configured debuggers.project.serverReadyAction with the action generated from launchSettings.json, preventing users from overriding the default browser-opening behavior. The generated serverReadyAction is now treated as a default, and any user-provided value is preserved.

What changed

  • Updated src/frontend/src/content/docs/get-started/aspire-vscode-extension.mdx to document that project.serverReadyAction can be set explicitly to override the generated default, with a JSON example matching the source PR's user-facing usage snippet.

Files modified

  • src/frontend/src/content/docs/get-started/aspire-vscode-extension.mdx (updated, existing page)

Generated by PR Documentation Check for #19200 · auto · 36.4 AIC · ⌖ 7.5 AIC · ⊞ 19.4K ·

@aspire-repo-bot aspire-repo-bot Bot added the docs-from-code Copilot initiated issue from dotnet/aspire repo label Aug 11, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #1459. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #1459 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

@ellahathaway
Ella Hathaway (ellahathaway) marked this pull request as ready for review August 11, 2026 16:16
Copilot AI lite review requested due to automatic review settings August 11, 2026 16:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents how the Aspire VS Code extension handles serverReadyAction for C#/.NET projects, specifically clarifying that users can override the extension-generated default.

Changes:

  • Adds guidance explaining that a generated serverReadyAction can be overridden via launch configuration.
  • Adds a JSON example showing how to set a custom serverReadyAction pattern/action.
Suppressed comments (1)

src/frontend/src/content/docs/get-started/aspire-vscode-extension.mdx:141

  • This JSON example is presented as a full .vscode/launch.json launch configuration, but it only contains the debuggers property. For consistency with the other examples in this page (and to avoid copy/paste confusion), include the standard Aspire launch configuration fields (type, request, name, program) alongside debuggers.
{
  "debuggers": {
    "project": {
      "serverReadyAction": {
        "action": "openIntegratedBrowser",

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/frontend/src/content/docs/get-started/aspire-vscode-extension.mdx Outdated

@adamint Adam Ratzman (adamint) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left two inline comments: debuggers.project also applies to the .NET AppHost, and the sample pattern truncates IPv6 URLs. The existing Copilot feedback already covers the property path and incomplete launch.json shape.

@IEvangelist David Pine (IEvangelist) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated docs-accuracy review — ⚠️ changes requested

Phase A source of truth: microsoft/aspire @ release/13.5 (SHA 1d922813c0f9bc14f7d817c817a8ab46b288bb44) — the branch this PR targets.
Claims extracted: 3 non-narrative → 1 verified, 1 contradicted, 1 unverifiable, 0 verified-with-nuance.
Phase B (doc-tester): exercised /get-started/aspire-vscode-extension/ on a local dev server serving this PR — page renders (HTTP 200), 0 critical, 0 warnings.

Headline

The new section documents a debuggers.project.serverReadyAction override that is not implemented on release/13.5. On this branch the extension unconditionally overwrites any user-supplied serverReadyAction for project resources, so the documented override has no effect. The mechanism that makes it work exists on main (guarded by serverReadyAction === undefined), so this doc appears to have landed on the release branch ahead of the code. See the two inline comments for the exact source evidence.


Phase A — Claim verification

Two inline comments are anchored to the affected lines (the contradicted override claim, and the openIntegratedBrowser example that doesn't exist on this branch).

✅ Verified claims (1) with evidence

Source (all microsoft/aspire@release/13.5): extension/src/debugger/languages/dotnet.ts, extension/src/debugger/debuggerExtensions.ts, extension/src/debugger/launchProfiles.ts, extension/src/test/dotnetDebugger.test.ts.

  1. "For project, the extension normally generates a serverReadyAction from the project's launchSettings.json to automatically open the browser when the server is ready." (config/behavior)verified.
    dotnet.ts:451-452 sets debugConfiguration.serverReadyAction = determineServerReadyAction(baseProfile?.launchBrowser, baseProfile?.applicationUrl, baseProfile?.launchUrl) for every non-AppHost (project) resource. determineServerReadyAction (launchProfiles.ts:368-383) reads those launch-profile fields and returns { action: "openExternally", pattern: "\\bNow listening on:\\s+https?://\\S+", uriFormat }. Corroborated by dotnetDebugger.test.ts:1736-1738 ("serverReadyAction should be present with the applicationUrl").
    Minor nuance: the generated action is openExternally (opens the external browser), and it is only produced when the profile has launchBrowser: true and an applicationUrl; otherwise none is generated.

Phase B — Doc-tester results (blind "new user" pass, no source code consulted)

Route exercised: /get-started/aspire-vscode-extension/ (served from a local Astro dev server with this PR's content; navigated via playwright-cli).

✅ Passed checks

  • Page compiles and returns HTTP 200; title "Aspire Visual Studio Code extension | Aspire". No MDX/compile errors, no browser console errors.
  • The new paragraph renders with correct inline-code formatting (serverReadyAction, launchSettings.json, project.serverReadyAction).
  • The new JSON block renders with its title ".vscode/launch.json — override the generated serverReadyAction", correct syntax highlighting, and a working copy button; it is placed logically between the debuggers-keys paragraph and the following env/args paragraph.

🔴 Critical issues

  • None (rendering).

⚠️ Warnings

  • None.

💡 Recommendations / knowledge gaps (minor, non-blocking)

  • The allowed action values aren't enumerated, so a reader can't tell what is valid besides the openIntegratedBrowser shown.
  • The relationship between the pattern capture group and the URL the browser opens isn't explained.

Blind-user note: nothing on the rendered page reveals the accuracy problem — it reads as a well-formed, working feature. The mismatch is only detectable by checking the extension source on the target branch (Phase A). This is the intended division of labor between the two phases.


Verdict

REQUEST_CHANGES — one contradicted claim: the documented project.serverReadyAction override does not function on release/13.5 (the user value is silently overwritten by the generated default). Suggested resolution: port the override support (the serverReadyAction === undefined guard in dotnet.ts) to release/13.5, or retarget this documentation to the branch/release where the override actually ships. The "generated default" paragraph (verified) is accurate and can stay.

Reviewed head SHA 2e8a9a725e00bc1e43fb1addd00669c0913e5082. Phase A read microsoft/aspire@release/13.5: extension/src/debugger/{languages/dotnet.ts, debuggerExtensions.ts, launchProfiles.ts, test/dotnetDebugger.test.ts}.

"project": {
"serverReadyAction": {
"action": "openIntegratedBrowser",
"pattern": "Now listening on:\\s+\\[?(https?://[^\\]\\s]+)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unverifiable on release/13.5. The value openIntegratedBrowser (and this exact pattern) does not appear anywhere in the extension source or tests on this branch. The only serverReadyAction action the extension produces or tests on release/13.5 is openExternally (extension/src/debugger/launchProfiles.ts:380). This exact example — action: 'openIntegratedBrowser' with pattern: 'Now listening on:\\s+\\[?(https?://[^\\]\\s]+)' — is present only on main (e.g. extension/src/test/dotnetDebugger.test.ts), which is additional evidence that the override feature this example illustrates has not yet shipped in release/13.5.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backport PR in microsoft/aspire#19451. This is doc change was a bit of a gray area because the VS Code extension releases independently from main, but we had already branched for 13.5 before the change reflected in this documentation was merged. As a result, the latest extension release includes the change, but 13.5 itself does not.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@IEvangelist David Pine (IEvangelist) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated docs-accuracy review — ⚠️ changes requested (revision 4a97126)

Phase A source of truth: microsoft/aspire @ release/13.5 (SHA e076d8e427cb3afb528dbd605acd74c3aea69f94) — the branch this PR targets. Cross-checked main (SHA 7adcc4c92d9c48d96050096a2c37afb0ee7ba219) only to locate where the underlying fix lives.
Claims: 6 non-narrative → ❌ 1 contradicted · ⚠️ 1 unverifiable · 🟡 2 verified-with-nuance · ✅ 2 verified.
Phase B (doc-tester): exercised /get-started/aspire-vscode-extension/ on a local dev server serving this revision — page renders (HTTP 200), 0 critical, 0 warnings.

Headline (re-review of the updated revision)

Thanks for the update — the new AppHost behavior note is accurate (verified below). However, the core issue from the previous review still stands: on release/13.5 a user-supplied debuggers.project.serverReadyAction is silently overwritten for project resources, so the documented override does not take effect on the branch this PR targets. The fix that makes the override work (and that stops the extension generating a default at all) lives on main (source PR #19200, milestone 13.6), not on release/13.5. See the two inline comments.

Verdict: REQUEST_CHANGES — one contradicted claim (the override) plus an unverifiable action value. Suggested resolution (unchanged): retarget this doc to the release where #19200 ships, or wait until the fix is on release/13.5.


Phase A — Claim verification

Two inline comments are anchored to the affected lines.

✅ Verified / 🟡 verified-with-nuance claims (4) with evidence

All evidence is microsoft/aspire@release/13.5.

  • D1 — "For project, the extension normally generates a serverReadyAction from launchSettings.json to automatically open the browser." 🟡 verified-with-nuance. extension/src/debugger/languages/dotnet.ts:451-452 sets it for non-apphost resources via determineServerReadyAction(...); extension/src/debugger/launchProfiles.ts:368-384 returns { action: "openExternally", pattern: "\\bNow listening on:\\s+https?://\\S+", uriFormat } only when launchBrowser === true and applicationUrl is present. Nuance: the generated action is openExternally (external browser), and none is produced for the AppHost itself (dotnet.ts:451 guards !isApphost).
  • D4 — example pattern "\\bNow listening on:\\s+(https?://\\S+)". 🟡 verified-with-nuance. Matches the generated default pattern launchProfiles.ts:381 ("\\bNow listening on:\\s+https?://\\S+"); the example just adds a capture group. Fine.
  • D5 — "A .NET AppHost also uses the project debugger, so debuggers.project.serverReadyAction is included in its debug configuration."verified. The AppHost is handled by projectDebuggerExtension (dotnet.ts:396 resourceType: 'project'), and extension/src/debugger/debuggerExtensions.ts:75-76 applies debuggers[launchConfig.type] (i.e. debuggers['project']) for it.
  • D6 — "If you set both debuggers.apphost.serverReadyAction and debuggers.project.serverReadyAction, the project value takes precedence."verified. debuggerExtensions.ts:70-77 Object.assigns debuggers['apphost'] first (line 71) then debuggers['project'] (line 76), so project wins; and for the AppHost the callback skips the generated overwrite (dotnet.ts:451), so the merged project value survives.

Phase B — Doc-tester results (blind "new user" pass, no source consulted)

Route exercised: /get-started/aspire-vscode-extension/ (served from a local Astro dev server with this revision's content).

✅ Passed checks

  • Page compiles, returns HTTP 200 (title "Aspire Visual Studio Code extension | Aspire"), 0 browser console errors.
  • New paragraph renders with correct inline-code formatting; the :::note[AppHost behavior] renders as a callout with the precedence sentence.
  • The new JSON block renders with title ".vscode/launch.json — override debuggers.project.serverReadyAction", correct highlighting and a working copy button, placed logically between the debuggers-keys paragraph and the following env/args paragraph.

🔴 Critical issues

  • None (rendering).

⚠️ Warnings

  • None (rendering).

💡 Recommendations / knowledge gaps (minor, non-blocking)

  • The allowed action values aren't enumerated, so a reader can't tell what is valid besides the openIntegratedBrowser shown.
  • The relationship between the pattern capture group and the URL the browser opens isn't explained.

Blind-user note: nothing on the rendered page reveals the accuracy problem — it reads as a well-formed, working feature. The mismatch is only detectable by checking the extension source on the target branch (Phase A). This is the intended division of labor between the two phases.

Reviewed head SHA 4a97126da745ea67ffa5ac191beb37db21b2a372. Phase A read microsoft/aspire@release/13.5 extension/src/debugger/{languages/dotnet.ts, debuggerExtensions.ts, launchProfiles.ts}; main consulted only to locate the #19200 fix.


The `debuggers` property forwards configuration to specific debuggers. Recognized keys are: `apphost`, `project` (C#/.NET), `node`, `python`, `browser`, and `azure-functions`.

For `project`, the extension normally generates a `serverReadyAction` from the project's `launchSettings.json` to automatically open the browser when the server is ready. Set `debuggers.project.serverReadyAction` explicitly to override this generated default with your own action and pattern:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contradicted on release/13.5. This paragraph says a user can override the generated default, but on this branch that override is discarded for project resources. In extension/src/debugger/debuggerExtensions.ts:51-78 the user's debuggers.project (including serverReadyAction) is merged into the debug configuration before the .NET callback runs; then extension/src/debugger/languages/dotnet.ts:451-452 unconditionally reassigns serverReadyAction = determineServerReadyAction(...) for every non-AppHost project, overwriting the user value. The guard that preserves an explicitly-configured value only exists on main (dotnet.ts comment: "A serverReadyAction the user configured explicitly in launch.json is still respected … never overwritten here"), where the extension also no longer generates one from launchSettings.json at all. So on release/13.5 this describes behavior that doesn't ship yet — retarget to the release carrying microsoft/aspire#19200, or hold until it lands on release/13.5.

(Note: the override does survive for the AppHost, because dotnet.ts:451 skips the generated action when isApphost — which is why the AppHost note below is accurate. But the "override this generated default" scenario is the project case, where it's overwritten.)

"debuggers": {
"project": {
"serverReadyAction": {
"action": "openIntegratedBrowser",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openIntegratedBrowser can't be verified as a valid action. It has zero occurrences in microsoft/aspire@release/13.5, and the extension's own ServerReadyAction type (extension/src/debugger/launchProfiles.ts:362-366) declares action: "openExternally" — which is also the only action the extension ever generates (launchProfiles.ts:380). serverReadyAction is ultimately consumed by VS Code core, but nothing in the Aspire extension produces or recognizes openIntegratedBrowser, so this example is likely to mislead. Consider using openExternally (the value the generated default uses), or documenting the exact set of supported action values.

@adamint Adam Ratzman (adamint) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not have anything to add beyond the existing review threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-from-code Copilot initiated issue from dotnet/aspire repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants